<?php
class Tasks extends notifications
{
    
    public function task_validation($auth){
        $date = functions::currentDateTime();
        $ret = "";
        $get_task = $this->query("SELECT * FROM `tbtasks` WHERE FIND_IN_SET(" . $auth['id'] . ",member) > 0 AND due_date < NOW()","array");
        //$num_task = $this->query("SELECT * FROM `tbtasks` WHERE FIND_IN_SET(" . $auth['id'] . ",member) > 0 AND due_date < NOW()","numrows");
        //if($num_task!=0){
            foreach($get_task as $task){
                $same_task = $this->query("SELECT * FROM `tbtasks` WHERE noti_id={$this->escape($task['id'])} AND userID={$this->escape($auth['id'])} AND type={$this->escape(13)}","numrows");
                if($same_task!=0){
                    $this->taskNotification("task_out","tbtasks",$auth,$task['id'],$task['member'],"","");
                }
            }
        //}
        
        //$ret[] = array("numrows"    =>      $num_task,
        //               "info"       =>      $get_task);
        //
        //return json_encode($ret);
    }
    
}
?>